Adding Samples to Media Structures
This section describes Movie Toolbox functions that directly manipulate media
samples. These functions are used only by applications that create movies or add data to existing movies.You add samples to a media by calling the
AddMediaSample
function. You can indicate that the sample to be added is not a sync sample. Sync samples do not rely on preceding frames for content. Some compression algorithms conserve space by eliminating duplication between consecutive frames in a sample. In image data, sync samples are referred to as key frames. For more information on key frames, see the chapter "Image Compression Manager" in this book.You can obtain the data in a media sample by calling the
GetMediaSample
function.
If you are going to add samples to a media, you must do so within a media-editing session. You start a media-editing session by calling theBeginMediaEdits
function. Once you have finished adding samples to the media, you end the editing session by calling theEndMediaEdits
function.Once you have added samples to a media, you can work with references to those samples by calling the
AddMediaSampleReference
andGetMediaSampleReference
functions. You do not have to be in a media-editing session to use these functions.
Subtopics
- BeginMediaEdits
- EndMediaEdits
- AddMediaSample
- AddMediaSampleReference
- GetMediaSample
- GetMediaSampleReference